﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using GoGrid;

namespace GoGrid
{
    public class DataCenter : IModifier
    {
        public DataCenter(int value)
            : this(value.ToString())
        {
        }

        public DataCenter(string value)
        {
            this.Value = value;
        }

        public string Value { get; set; }

        public static DataCenter Any
        {
            get
            {
                return new DataCenter(string.Empty);
            }
        }

        public static DataCenter USWest1
        {
            get
            {
                return new DataCenter(1);
            }
        }

        public static DataCenter USEast1
        {
            get
            {
                return new DataCenter(2);
            }
        }

        public void Apply(Dictionary<string, string> parameters, Connection connection)
        {
            if (!string.IsNullOrEmpty(this.Value))
            {
                parameters.Add("datacenter", this.Value);
            }
        }
    }
}